﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuanLyVaiTro.ascx.cs" Inherits="Solutions.Admin.QuanLyVaiTro.QuanLyVaiTro" %>
<dx:ASPxButton ID="btnOpenForm" Theme="Aqua" runat="server" AutoPostBack="False" EncodeHtml="False" Height="22px" Text="Thêm mới" OnClick="OpenForm_Click">
    <Image Url="../Skins/style/IMG/icon/Add.png" Width="16px" Height="16px" />
</dx:ASPxButton>
<dx:ASPxTextBox runat="server" Visible="False" ID="hdIdMenu"></dx:ASPxTextBox><dx:ASPxTextBox runat="server" Visible="False" ID="hdIdVaiTro"></dx:ASPxTextBox>
<dx:ASPxGridView ID="grdDanhSachMenu" runat="server" Caption="Danh sách vai trò" Width="100%" OnRowCommand="grdTest_RowCommand"
    KeyFieldName="pk_iVaiTroID" AutoGenerateColumns="False" EnableTheming="True" Theme="Aqua">

    <Columns>
        <dx:GridViewDataTextColumn Caption="STT" CellStyle-HorizontalAlign="Center" VisibleIndex="0" Width="40" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <DataItemTemplate>
                <%#Container.ItemIndex +1 %>
            </DataItemTemplate>
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
          <dx:GridViewDataTextColumn FieldName="pk_iVaiTroID" Width="200" Caption="makey" VisibleIndex="1" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
                                    <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="sTenVaiTro" Width="200" Caption="Tên vai trò" VisibleIndex="1" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="sGhiChu" Width="200" Caption="Ghi chú" VisibleIndex="2" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="sNguoiTao" Width="200" Caption="Người tạo" VisibleIndex="3" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="sNguoiCapNhat" Width="200" Caption="Người sửa" VisibleIndex="4" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="dNgayTao" Width="200" Caption="Ngày tạo" VisibleIndex="5" CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="dNgayCapNhat" Width="200" Caption="Ngày sửa" VisibleIndex="6" CellStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn Caption="Edit" VisibleIndex="7" Width="40px" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center">
            <DataItemTemplate>
                <asp:ImageButton ID="imbEdit" runat="server"
                    CommandName="Edit"
                    ImageUrl="../Skins/style/IMG/icon/Edit.png" ClientIDMode="Static" />
            </DataItemTemplate>

            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>

            <CellStyle HorizontalAlign="Center"></CellStyle>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn Caption="Delete" VisibleIndex="8" Width="40px" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center">
            <DataItemTemplate>
                <asp:ImageButton ID="imbEdit" runat="server"
                    CommandName="Delete"
                    ImageUrl="../Skins/style/IMG/icon/Delete.png" ClientIDMode="Static" />
            </DataItemTemplate>

            <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>

            <CellStyle HorizontalAlign="Center"></CellStyle>
        </dx:GridViewDataTextColumn>
    </Columns>
    <Styles>
        <AlternatingRow Enabled="true" />
    </Styles>
    <SettingsBehavior AllowSelectByRowClick="true" />
    <Settings VerticalScrollableHeight="430" ShowFilterRow="true" />
    <SettingsPager Position="Bottom" PageSize="20">
        <PageSizeItemSettings Items="10, 20, 50" />
    </SettingsPager>
</dx:ASPxGridView>
<dx:ASPxPopupControl ID="wdsQuanLyMenu" HeaderStyle-Font-Bold="True" runat="server" HeaderImage="../Skins/style/IMG/icon/Delete.png" Width="730px" HeaderText="Thông tin vai trò" AllowResize="False" ClientInstanceName="popupControl" Height="320px" Modal="True" CloseAction="CloseButton" AllowDragging="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" Theme="Aqua">
    <HeaderStyle Font-Bold="True"></HeaderStyle>
    <ContentCollection>
        <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
            <table style="margin-top: 5px; margin-left: 5px;">
                <tr style="float: left; margin-bottom: 10px;">
                    <td style="width: 120px; vertical-align: top;">Tên vai trò <span class="redLabel">(*)</span>: &nbsp;
                    </td>
                    <td style="width: 560px; vertical-align: top;">
                        <dx:ASPxTextBox ID="txtTenVaiTro" runat="server" Height="25px" Width="560px" ClientInstanceName="txtPopup">
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr style="float: left; margin-bottom: 10px;">
                    <td style="width: 120px; vertical-align: top;">Ghi chú : &nbsp;
                    </td>
                    <td style="width: 560px; vertical-align: top;">
                        <dx:ASPxMemo ID="txtsGhiChu" runat="server" Width="560px" Height="71px">
                        </dx:ASPxMemo>
                    </td>
                </tr>
            </table>
            <%--Grid danh sách quyền--%>
            <table style="margin-top: 5px; margin-left: 5px;">
                <tr style="float: left; margin-bottom: 10px;">
                    <td style="width: 120px; vertical-align: top;">Gán quyền : &nbsp;
                    </td>
                    <td style="width: 560px; vertical-align: top;">
                        <dx:ASPxGridView ID="grdDanhSachQuyen" runat="server" Caption="Danh sách quyền" Width="100%" OnRowCommand="grdTest_RowCommand"
                            KeyFieldName="pk_iQuyenID" AutoGenerateColumns="False" EnableTheming="True" Theme="Aqua" ClientInstanceName="grdDanhSachQuyen">
                            <Columns>
                                <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                                    <HeaderTemplate>
                                        <dx:ASPxCheckBox ID="SelectAllCheckBox" runat="server" ToolTip="Select/Unselect all rows on the page"
                                            ClientSideEvents-CheckedChanged="function(s, e) { grdDanhSachQuyen.SelectAllRowsOnPage(s.GetChecked()); }" />
                                    </HeaderTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn Caption="STT" VisibleIndex="0" Width="40" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center">
                                    <DataItemTemplate>
                                        <%#Container.ItemIndex +1 %>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                </dx:GridViewDataTextColumn>
                                
                                <dx:GridViewDataTextColumn FieldName="sTenQuyen" Width="200" Caption="Tên quyền" VisibleIndex="1" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
                                    <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="sTenTaiNguyen" Width="200" Caption="Tên tài nguyên" VisibleIndex="2" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
                                    <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="sTenMenu" Width="200" Caption="Menu" VisibleIndex="3" HeaderStyle-Font-Bold="True" HeaderStyle-HorizontalAlign="Center">
                                    <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <Styles>
                                <AlternatingRow Enabled="true" />
                            </Styles>
                            <SettingsBehavior AllowGroup="false" AllowDragDrop="false" />
                            <Settings VerticalScrollableHeight="430" ShowFilterRow="true" />
                            <SettingsPager Position="Bottom" PageSize="10">
                                <PageSizeItemSettings Items="10, 20, 50" />
                            </SettingsPager>
                        </dx:ASPxGridView>
                    </td>
                </tr>
            </table>
            <%--End--%>
            <table style="border: none; float: right; margin-right: 5px; margin-bottom: 10px;">
                <tr>
                    <td>
                    <td style="float: left; margin-right: 10px;">
                        <dx:ASPxButton ID="btnLuuLai" runat="server" EncodeHtml="False" AutoPostBack="False" Text="Lưu lại"  OnClick="LuuLai_Click">
                            <Image Url="../Skins/style/IMG/icon/Save.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                    <td style="float: left; margin-right: 10px;">
                        <dx:ASPxButton ID="btnUpdate" runat="server" EncodeHtml="False" AutoPostBack="False" Text="Lưu lại"  OnClick="Update_Click">
                            <Image Url="../Skins/style/IMG/icon/SaveEdit.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                    <td style="float: left;">
                        <dx:ASPxButton ID="btnReset" runat="server" EncodeHtml="False" AutoPostBack="False" Text="Xóa trắng" OnClick="Reset_Click">
                            <Image Url="../Skins/style/IMG/icon/Clear.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                    <td style="float: left; margin-left: 10px;">
                        <dx:ASPxButton ID="btnDong" runat="server" AutoPostBack="False" ClientInstanceName="btnCancel"
                            Text="Đóng" >
                            <ClientSideEvents Click="function(s, e) {popupControl.Hide();}" />
                            <Image Url="../Skins/style/IMG/icon/Close.png" Width="16px" Height="16px" />
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>
